# -*- coding: utf-8 -*-
# @File : .py
# @Author : ZhouHang
# @Date : 20-4-16
# @Desc :

from rest_framework import serializers

from .models import Area

class AreaSerializer(serializers.ModelSerializer):
    """行政省"""
    class Meta:
        model = Area
        fields = ('id', 'name')


class SubAreaSerializer(serializers.ModelSerializer):
    subs = AreaSerializer(many=True,read_only=True)
    class Meta:
        model = Area
        fields = ('id','name','subs')